# Fusion-icon is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Fusion-icon is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): crdlb, nesl247
#
# Copyright 2007 Christopher Williams <christopherw@verizon.net>
import os
from execute import run
tfp = 'GLX_EXT_texture_from_pixmap'
GDSID = 'GNOME_DESKTOP_SESSION_ID'
class Environment:
'''Detects properties of the enviroment, and provides a set() method that uses this information to export environment variables needed to start compiz.'''
def __init__(self):
'''desktop: current desktop enviroment used to choose interface, fallback wm, and default decorator
failsafe: boolean, True if in a failsafe session, currently only supports gnome failsafe mode.
glxinfo: output of glxinfo command
indirect_glxinfo: output of glxinfo with LIBGL_ALWAYS_INDIRECT
xvinfo: output of xvinfo
glx_vendor: 'client glx vendor:' usually one of SGI (for mesa-based drivers), NVIDIA Corporation, or ATI.
tfp: 'direct' if texture_from_pixmap is present with direct rendering (implying presence with indirect as well), 'indirect' if only present with indirect context, False if not present at all
Xgl: True in Xgl'''
# Check gnome- and kde-specific vars, then try generic 'DESKTOP_SESSION'